/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.settlement.entity.carpresettlement;

import javax.validation.constraints.NotBlank;

import com.jeesite.modules.order.entity.serviceorder.RelatedRecord;
import org.hibernate.validator.constraints.Length;

import java.util.Date;
import java.util.List;
import com.jeesite.common.collect.ListUtils;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.modules.bpm.entity.BpmEntity;

/**
 * 车辆预结算单Entity
 * @author shengbin
 * @version 2021-04-07
 */
@Table(name="t_car_presettlement", alias="a", columns={
		@Column(name="car_presettlement_id", attrName="carPresettlementId", label="系统编号", isPK=true),
		@Column(name="customer_id", attrName="customerId", label="客户"),
		@Column(name="service_order_id", attrName="serviceOrderId", label="服务订单"),
		@Column(name="frame_number", attrName="frameNumber", label="车架号"),
		@Column(name="presttlement_rate", attrName="presttlementRate", label="预结算汇率"),
		@Column(name="car_name", attrName="carName", label="车辆名称", queryType=QueryType.LIKE),
		@Column(name="row_number", attrName="rowNumber", label="服务订单行号"),
		@Column(name="status", attrName="status1", label="状态"),
		@Column(name="create_by", attrName="createBy", label="创建者"),
		@Column(name="create_date", attrName="createDate", label="创建时间"),
		@Column(name="update_by", attrName="updateBy", label="更新者"),
		@Column(name="update_date", attrName="updateDate", label="更新时间"),
		@Column(name="remarks", attrName="remarks", label="备注信息", queryType=QueryType.LIKE),
		@Column(name="approve_status", attrName="approveStatus", label="审批状态"),
	}, orderBy="a.update_date DESC"
)
public class TcarPresettlement extends DataEntity<TcarPresettlement> {
	
	private static final long serialVersionUID = 1L;
	private String carPresettlementId;		// 系统编号
	private String customerId;		// 客户
	private String serviceOrderId;		// 服务订单
	private String frameNumber;		// 车架号
	private String presttlementRate;		// 预结算汇率
	private String carName;		// 车辆名称
	private Long rowNumber;		// 服务订单行号
	private String approveStatus;		// 审批状态
	private String status1;//状态

	public String getStatus1() {
		return status1;
	}

	public void setStatus1(String status1) {
		this.status1 = status1;
	}

	private List<TcarPresettlementDetail> tcarPresettlementDetailList = ListUtils.newArrayList();		// 子表列表

	private List<RelatedRecord> relatedRecordList = ListUtils.newArrayList();		// 子表列表

	public List<RelatedRecord> getRelatedRecordList() {
		return relatedRecordList;
	}

	public void setRelatedRecordList(List<RelatedRecord> relatedRecordList) {
		this.relatedRecordList = relatedRecordList;
	}


	public TcarPresettlement() {
		this(null);
	}

	public TcarPresettlement(String id){
		super(id);
	}
	
	public String getCarPresettlementId() {
		return carPresettlementId;
	}

	public void setCarPresettlementId(String carPresettlementId) {
		this.carPresettlementId = carPresettlementId;
	}
	
	@NotBlank(message="客户不能为空")
	@Length(min=0, max=64, message="客户长度不能超过 64 个字符")
	public String getCustomerId() {
		return customerId;
	}

	public void setCustomerId(String customerId) {
		this.customerId = customerId;
	}
	
	@NotBlank(message="服务订单不能为空")
	@Length(min=0, max=64, message="服务订单长度不能超过 64 个字符")
	public String getServiceOrderId() {
		return serviceOrderId;
	}

	public void setServiceOrderId(String serviceOrderId) {
		this.serviceOrderId = serviceOrderId;
	}
	
	@NotBlank(message="车架号不能为空")
	@Length(min=0, max=100, message="车架号长度不能超过 100 个字符")
	public String getFrameNumber() {
		return frameNumber;
	}

	public void setFrameNumber(String frameNumber) {
		this.frameNumber = frameNumber;
	}
	
	@NotBlank(message="预结算汇率不能为空")
	@Length(min=0, max=10, message="预结算汇率长度不能超过 10 个字符")
	public String getPresttlementRate() {
		return presttlementRate;
	}

	public void setPresttlementRate(String presttlementRate) {
		this.presttlementRate = presttlementRate;
	}
	
	@Length(min=0, max=100, message="车辆名称长度不能超过 100 个字符")
	public String getCarName() {
		return carName;
	}

	public void setCarName(String carName) {
		this.carName = carName;
	}
	
	public Long getRowNumber() {
		return rowNumber;
	}

	public void setRowNumber(Long rowNumber) {
		this.rowNumber = rowNumber;
	}
	
	@Length(min=0, max=1, message="审批状态长度不能超过 1 个字符")
	public String getApproveStatus() {
		return approveStatus;
	}

	public void setApproveStatus(String approveStatus) {
		this.approveStatus = approveStatus;
	}
	
	public Date getCreateDate_gte() {
		return sqlMap.getWhere().getValue("create_date", QueryType.GTE);
	}

	public void setCreateDate_gte(Date createDate) {
		sqlMap.getWhere().and("create_date", QueryType.GTE, createDate);
	}
	
	public Date getCreateDate_lte() {
		return sqlMap.getWhere().getValue("create_date", QueryType.LTE);
	}

	public void setCreateDate_lte(Date createDate) {
		sqlMap.getWhere().and("create_date", QueryType.LTE, createDate);
	}
	
	public List<TcarPresettlementDetail> getTcarPresettlementDetailList() {
		return tcarPresettlementDetailList;
	}

	public void setTcarPresettlementDetailList(List<TcarPresettlementDetail> tcarPresettlementDetailList) {
		this.tcarPresettlementDetailList = tcarPresettlementDetailList;
	}
	
}